<!doctype html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- 必须的 meta 标签 -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap 的 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../../static/css/main.css" th:href="@{/static/css/main.css}">
    <title>用户中心</title>
</head>
<body>
<nav class="nav nav-pills nav-justified">
    <a class="nav-link" th:href="@{/book/randBook}">首页</a>
    <a class="nav-link" th:href="@{/book/bookBrother}">分类与购买</a>
    <a class="nav-link active" th:href="@{/admin/userCenter}">个人中心</a>
    <a class="nav-link" th:href="@{/shop/selectAllShop}">购物车</a>
    <a class="nav-link" th:href="@{/order/selectOrderLastAll}">查询订单</a>
</nav>
<div class="container">
    <div class="row">
        <div class="offset-4" style="margin-top: 50px">
            <span th:text="${message}" style="color: red"></span>
            <div class="card" style="width: 18rem;">
                <img src="../../../static/img/dog.jpeg" th:src="@{/static/img/dog.jpeg}" class="card-img-top" alt="...">
                <div class="card-body">
                    <h5 class="card-title" th:text="${user.username}">用户名</h5>
                    <p class="card-text" >我的前端技术可是真的....好看....</p>
                </div>
                <ul class="list-group list-group-flush">
                    身份：<li class="list-group-item" th:text="${user.identity}">管理员</li>
                    余额：<li class="list-group-item" th:text="${user.money}">1000000<span>亿元</span></li>
                    注册时间：<li class="list-group-item" th:text="${user.createTime}">2022-10-10</li>
                </ul>
                <div class="card-body">
                    <a href="#" id="yue" class="card-link">余额充值🤑</a>
                    <a href="#" id="xinxi" class="card-link">信息修改👻</a>
                </div>
            </div>
        </div>
    </div>
</div>


<!--模态-->
<div id="myModal1" class="modal" tabindex="-1">
    <div class="container">
        <div class="modal-content">
            <div class="modal-body">
                <form th:action="@{/admin/updateUserMoney}">
                    余额充值：<input type="text" name="money"><br>
                    <button type="submit">冲它一个亿</button>
                </form>
            </div>
        </div>
    </div>
</div>


<!--模态-->
<div id="myModal2" class="modal" tabindex="-1">
    <div class="container">
        <div class="modal-content">
            <div class="modal-body">
                <form th:action="@{/admin/updateUserByUserName}" method="post">
                    用户名：<input type="text" name="username"><br>
                    密码：<input type="password" name="password"><br>
                    <button type="submit">修改</button>
                </form>
            </div>
        </div>
    </div>
</div>








<!-- JavaScript 文件是可选的。从以下两种建议中选择一个即可！ -->
<!-- 选项 1：jQuery 和 Bootstrap 集成包（集成了 Popper） -->

<script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js"></script>

<script>

    //模态窗口 因为thymeleaf没刷新这里，所以不需要处理
    $('#yue').click(function () {
        $('#myModal1').modal('show')
        ;
    });

    $('#xinxi').click(function () {
        $('#myModal2').modal('show')
        ;
    });
</script>
</body>
</html>
